package org.yray.neo4j.test;

import org.neo4j.driver.*;

public class Neo4jServerMain {
    public static void main(String[] args) {
        Driver driver = GraphDatabase.driver( "bolt://172.168.198.16:7687",
                AuthTokens.basic( "neo4j", "neo4j123" ) );
        Session session = driver.session();
        String cql = "MATCH (a:Person) RETURN a ";
        Result result = session.run(cql);
        while ( result.hasNext() ) {
            Record record = result.next();
            Value value = record.get("a");
            System.out.println( value.get( "name" ).asString() + " " + value.get( "age" ) );
        }
        session.close();
        driver.close();
    }
}
